package utils

import (
	"fmt"
	"os"
)

func ReadDeploymentYaml(resource string) (string, error) {
	/*
		更具请求url路径判断获取模板的资源类型
	*/
	dir, _ := os.Getwd()
	file, err := os.ReadFile(dir + "/" + "tmeplate/" + resource + ".yaml")
	if err != nil {
		fmt.Println("yaml文件读取错误：", err)
		return "", err
	} else {
		base64, err := EncodeBase64(file)
		if err != nil {
			return "", err
		} else {
			return base64, nil
		}

	}

}
